package com.project.config;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.profile.DefaultProfile;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Configuration
public class AliyunMsgConfig {
    @Resource
    private MsgProperites msgProperites;
    @Bean
    public IAcsClient iAcsClient(){
        DefaultProfile profile = DefaultProfile.getProfile(msgProperites.getRegionId(),
                msgProperites.getAccessKeyId(),msgProperites.getAccessKeySecret());
        DefaultAcsClient acsClient = new DefaultAcsClient(profile);
        return acsClient;
    }
}
